﻿namespace CodeBlock

open Mono.Cecil

open System.Collections.Generic

open TokenIdentity

type RuntimeType() =
    override this.ToString() =
        "RuntimeType.ToString is not implemented"

type ExecutionEngine() =
    let runtimeTypes = Dictionary<RuntimeTypeID, RuntimeType>()
    
    member private this.Load typeref =
        RuntimeType()
    
    member this.GetType typeref =
        let typeID = GetTypeID typeref
        let succ, rtype = runtimeTypes.TryGetValue typeID
        if succ then
            rtype
        else
            this.Load typeref
            
